if(!window.xflib || !window.xflib.client) window.xflib = { client: {} }

xflib.client.Application = class Application {

    static ioc = {
        productUi: null,
        categoryUi: null,
        projectUi: null
    }

    static getBean = function(beanName){
        return window.xflib.client.Application.ioc[beanName];
    }

    static registerBean = function(key, value){
        window.xflib.client.Application.ioc[key] = value;
    }

    static refreshUi= function(){
        window.xflib.client.Application.ioc["productUi"].refreshProductSelect();
        window.xflib.client.Application.ioc["categoryUi"].refreshCategorySelect();
        // window.xflib.client.Application.ioc["projectUi"].refreshProjectSelect();
        window.xflib.client.Application.ioc["projectUi"].refreshProjectTable();
    }

    static UUID() {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
            var r = Math.random() * 16 | 0,
                v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    }
}
